package com.sumainfor.pc.market.feign;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.fallback.TenantFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @Author Eddy·Chen
 * @Email 835033913@qq.com
 * @Create 2019-02-26 18:56
 */
@FeignClient(name = "TANGNEST-WX-TENANT", fallback = TenantFeignFallback.class)
public interface TenantFeign {

    /**
     * 通过租客的ID 获得租客的信息数据
     *
     * @param tenId
     * @return
     */
    @PostMapping("/key/provider/getWxInfoByTenId")
    JsonResult getWxInfoByTenId(@RequestParam("tenId") String tenId);

    /**
     * 更新租客端
     *
     * @param params
     * @return
     */
    @PostMapping("/key/provider/updateWxInfoByTenId")
    JsonResult updateWxInfoByTenId(@RequestBody Map<String, Object> params);

    /**
     * 查询获取用户信息数据表格数据
     *
     * @param params
     * @return
     */
    @PostMapping("/key/coupons/selectTenantTableList")
    Page<Map<String, Object>> selectTenantTableList(@RequestParam Map<String, Object> params);


    /**
     * 查询租客信息通过租客手机号码
     *
     * @param phone
     * @return
     */
    @PostMapping("/key/provider/cfo/getTenantByPhone")
    JsonResult getTenantByPhone(@RequestParam("phone") String phone);

    /**
     * 获取所有的租客编号
     * @return
     */
    @GetMapping("/key/FeTenant/getTenantList")
    JsonResult getTenantList();


    @PostMapping("/key/FeTenant/getTenNameandPhone")
    List<Map<String,Object>> getTenNameandPhone(@RequestBody Map<String,Object> params);
}
